using System;
using System.Collections.Generic;
using System.Text;
using MoEngine;
using Microsoft.Xna.Framework;

namespace MoGame
{
    class WindowModelView : WindowScene
    {
        ModelNode m_Model;
        Camera m_Camera;

        public WindowModelView(WindowBase parent)
            : base(parent)
        {
            Scene = new Scene();
            
            m_Model = new ModelNode("Models/Plane");
            Scene.Root.Attach(m_Model);

            m_Camera = new Camera();
            m_Camera.LookAt(new Vector3(20, 20, 20), Vector3.Zero, Vector3.Up);
            Scene.Camera = m_Camera;
        }

        public override void Update(GameTime time)
        {
            base.Update(time);

            float yaw = (float)time.TotalGameTime.TotalSeconds * 1.0f;
            m_Model.Rotation = Matrix.CreateFromYawPitchRoll(yaw, 0, 0);

            m_Scene.Update();
        }
    }
}
